<template>
    <h2 style="text-align: center;">用户借款赎回信息类表</h2>
    <table style="text-align: center;">
         <thead style="background-color: aqua;">
           <tr>
               <th>用户借款编号</th>
               <th>借款项目名称</th>
               <th>借款最高金额</th>
               <th>借款年限</th>
               <th>借款利息</th>
               <th>借款金额</th>
               <th>操作</th>
           </tr>
         </thead>
         <tbody>
           <tr v-for="item in UserBorrowInfo" :key="item.UB_Id">
               <td>{{item.UB_Id}}</td>
               <td>{{item.B_Name}}</td>
               <td>{{item.B_MaxMoney}}</td>
               <td>{{item.B_Year}}</td>
               <td>{{item.I_Interest}}</td>
               <td>{{item.UB_Money}}</td>
                <td>
                    <slot :id="item.UB_Id"></slot>
                </td>
     

           </tr>
         </tbody>
    </table>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios'
import {useRouter} from 'vue-router'
import { useUserStore } from '../../store/index.ts';
const store = useUserStore();
const router = useRouter();
onMounted(()=>{
   LoadData();

})

const UserBorrowInfo = ref([
   {
     
       B_Name:'',
       B_MaxMoney:'',
       B_Year:'',
       I_Interest:'',
       UB_Id:0,
       UB_Money:0,

      
   }
])

//显示数据
const LoadData = ()=>{
  
    axios("https://localhost:44354/api/Borrows/ShowUserBorrowInfo",{
       params:{
         Uid:store.Uid
       }
    }).then(res=>{
       UserBorrowInfo.value = res.data;
      
    }).catch(err=>{
       console.log(err);
    })
}
</script>